package com.ruihu.admin.module.business.tasknode.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruihu.admin.module.business.tasknode.domain.dto.DefectTypeDTO;
import com.ruihu.admin.module.business.tasknode.domain.dto.DefectTypeQueryDTO;
import com.ruihu.admin.module.business.tasknode.domain.entity.DefectTypeEntity;
import com.ruihu.admin.module.business.tasknode.domain.vo.DefectTypeExcelVO;
import com.ruihu.admin.module.business.tasknode.domain.vo.DefectTypeVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * [ 缺陷类型配置 ]
 *
 * @author Tony
 * @version 1.0
 * @company 瑞虎（南京）信息技术有限公司
 * @copyright (c)  瑞虎（南京）信息技术有限公司Inc. All rights reserved.
 * @date 2022-09-04 10:46:11
 * @since JDK1.8
 */
@Mapper
@Component
public interface DefectTypeDao extends BaseMapper<DefectTypeEntity> {

    /**
     * 分页查询
     * @param queryDTO
     * @return DefectTypeVO
    */
    List<DefectTypeVO> queryByPage(Page page, @Param("queryDTO") DefectTypeQueryDTO queryDTO);

    /**
     * 查询列表
     * @param queryDTO
     * @return DefectTypeVO
     */
    List<DefectTypeDTO> queryByList(@Param("queryDTO") DefectTypeQueryDTO queryDTO);

    /**
     * 根据缺陷类型名称查询
     * @param defectTypeName
     * @return
     */
    DefectTypeDTO queryByDefectTypeName(@Param("defectTypeName") String defectTypeName);

    /**
     * 根据缺陷类型名称列表查询
     * @param defectTypeNameList
     * @return
     */
    List<DefectTypeDTO> queryByDefectTypeNameList(@Param("defectTypeNameList") List<String> defectTypeNameList);

    /**
     * 根据id删除
     * @param id
     * @return
    */
    void deleteById(@Param("id")Long id);

    /**
     * 根据id批量删除
     * @param idList
     * @return
    */
    void deleteByIdList(@Param("idList") List<Long> idList);

        /**
     * 查询所有导出数据
     * @param queryDTO
     * @return
     */
    List<DefectTypeExcelVO> queryAllExportData(@Param("queryDTO")DefectTypeQueryDTO queryDTO);

        /**
         * 查询批量导出数据
         * @param idList
         * @return
         */
    List<DefectTypeExcelVO> queryBatchExportData(@Param("idList")List<Long> idList);


    /**
      * 根据ID更新实体（忽略空值）
      */
    int updateByIdIgnoreEmptyValue(@Param("entity") DefectTypeEntity entity);

    /**
     * 根据ID更新实体
     */
    int updateById(@Param("entity") DefectTypeEntity entity);
}
